<template>
  <div class="hm-header">
    <div class="left">
      <slot name="left">
        <i class="iconfont iconjiantou2" @click="goBack"></i>
      </slot>
    </div>
    <div class="center">
      <slot name="center"></slot>
    </div>
    <div class="right">
      <slot name="right"></slot>
    </div>
  </div>
</template>

<script>
export default {
  methods: {
    goBack () {
      this.$router.go(-1)
    }
  }
}
</script>

<style lang="scss" scoped>
.hm-header {
  display: flex;
  align-items: center;
  height: 50px;
  line-height: 50px;
  padding: 0 15px;
  text-align: center;
  background-color: #fff;

  .left {
    width: 40px;
    text-align: left;
    .iconjiantou2 {
      display: block;
    }
  }

  .center {
    flex: 1;
    margin: 0 10px;
    font-weight: 700;
    color: #000;
    font-size: 14px;
  }

  .right {
    width: 40px;
    text-align: center;
  }
}
</style>
